package com.gljx.web.controller.JournalController;

import com.gljx.web.Entity.Person;
import com.gljx.web.Entity.User;
import com.gljx.web.dao.RecruitStudentDeductCollectJournalMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * 招生提成汇总 和 招生提成核算表
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/")
public class RecruitStudentDeductCollectJournalController {
	
	@Autowired
	private RecruitStudentDeductCollectJournalMapper recruitStudentDeductCollectJournalMapper;
	
	/**
	 * 招生提成汇总
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="queryRecruitStudentDeductCollectJournal/look.action")
	public String selRecruitStudentDeductCollectJournal(HttpServletRequest request)throws Exception{
		
		return "backHome/journaling/manageJournaling/recruitStudentDeductCollectJournaling/recruitStudentDeductCollectJournalingList";
	}
	
	/**
	 * 招生提成核算
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="queryRecruitStudentDeductJournal/look.action")
	public String selRecruitStudentDeductJournal(HttpServletRequest request)throws Exception{
		//获取登录人信息
		User user =(User)request.getSession().getAttribute("user");
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
		String time=df.format(new Date());
		List<Person> personList=recruitStudentDeductCollectJournalMapper.selRecruitStudentDeduct(user.getFcompanyid());
		request.setAttribute("personList", personList);
		request.setAttribute("time", time);
		return "backHome/journaling/manageJournaling/recruitStudentDeductJournaling/recruitStudentDeductJournalingList";
	}
	
	
	
}
